﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FilmManagement2.Founction;

namespace FilmManagement2.WebPage
{
    public partial class MainPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void admin_Click(object sender, EventArgs e)
        {

            if (submit.Visible == false)
            {
                submit.Visible = true;
                accountlbl.Visible = true;
                txtAccount.Visible = true;
                passwordlbl.Visible = true;
                txtPassword.Visible = true;
            }
            else
            {
                submit.Visible = false;
                accountlbl.Visible = false;
                txtAccount.Visible = false;
                passwordlbl.Visible = false;
                txtPassword.Visible = false;
            }

        }

        protected void submit_Click(object sender, EventArgs e)
        {
            ConnectToSql cts = new ConnectToSql();
            if (cts.AdminLog(txtAccount.Text, txtPassword.Text))
            {
                Session["AdminName"] = txtAccount.Text;
                Response.Redirect(@"AdminPage.aspx");
            }
            else {
                Response.Write("<script>alert('登陆失败')</script>");
            
            }
           
        }

        protected void bookticketbut_Click(object sender, EventArgs e)
        {
            Response.Redirect(@"BookPage_1.aspx");
        }

        protected void suggestbut_Click(object sender, EventArgs e)
        {
            Response.Redirect(@"SuggestionPage.aspx");
        }

        protected void hombut_Click(object sender, EventArgs e)
        {
            Response.Redirect(@"MainPage.aspx");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect(@"BookPage_1.aspx");
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect(@"BookPage_1.aspx");
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            Response.Redirect(@"BookPage_1.aspx");
        }

        protected void Button4_Click(object sender, EventArgs e)
        {
            Response.Redirect(@"BookPage_1.aspx");
        }
    }
}